<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    /*
    展开运算符
      展开运算符(...)用于将一个数组进行展开 ,不会修改原数组

     */

    // 合并数组
    const arr1=[1,2,3,4,5]
    const arr2=[6,7,8,9,10]
    const newArr=[...arr1,...arr2]
    console.log(newArr);// [1,2,3,4,5,6,7,8,9,10]

    //求数组最大最小值
    const max=Math.max(...arr1)
    const min=Math.min(...arr2)
    console.log(max,min);// 5 6
  </script>
</body>
</html>